package com.bestcem.xm.om.dao;

import com.bestcem.xm.om.controller.param.BookingParam;
import com.bestcem.xm.om.entity.UserBooking;

import java.util.List;

/**
 * 描述信息
 *
 * @author xuan.yang <xuan.yang@idiaoyan.com>
 * @version v1.0
 * @date 2022/2/22 14:49
 */
public interface UserBookingDao {

    /**
     * getById
     * @param id
     * @return
     */
    UserBooking getById(String id);

    /**
     * listAll
     * @return
     */
    List<UserBooking> listAll();

    /**
     * 拒绝预定
     *
     * @param id
     * @param reason
     * @return
     * @auther xuan.yang@idiaoyan.com
     * @date 2022/2/23 16:35
     */
    Long rejectBooking(String id, String reason);

    /**
     * 根据手机号和行业id判断是否存在
     *
     * @param contact    联系方式
     * @param industryId
     * @return boolean
     * @author zhangfeng <feng.zhang@idiaoyan.com>
     * @date 2022/2/23 14:48
     */
    boolean existsByContactAndIndustryId(String contact, String industryId);

    /**
     * 插入预约信息
     *
     * @param userBooking
     * @return void
     * @author zhangfeng <feng.zhang@idiaoyan.com>
     * @date 2022/2/23 15:51
     */
    UserBooking insert(UserBooking userBooking);

    /**
     * 更新预约信息
     *
     * @param id          唯一标注
     * @param oldStatuses 旧状态列表
     * @param userBooking 待修改状态
     * @return void
     * @author zhangfeng <feng.zhang@idiaoyan.com>
     * @date 2022/2/24 16:31
     */
    boolean updateByIdAndStatus(String id, List<Integer> oldStatuses, UserBooking userBooking);

    /**
     * pageUserBooking
     * @param bookingParam
     * @param industryIds
     * @return
     */
    List<UserBooking> pageUserBooking(BookingParam bookingParam, List<String> industryIds);

    /**
     * 预约申请导出 数据改为1.5w
     *
     * @param bookingParam
     * @param industryIds
     * @return
     */
    List<UserBooking> pageExportUserBooking(BookingParam bookingParam, List<String> industryIds);

    /**
     * pageUserBooking
     * @param bookingParam
     * @param industryIds
     * @return
     */
    Long countByCondition(BookingParam bookingParam, List<String> industryIds);

    /**
     * 通过客户id更新预约信息
     * @param userBooking
     * @return
     */
    Integer updateByCustomerId(UserBooking userBooking);

    /**
     * updateByDistributions
     * @param key
     * @param mail
     * @return
     */
    Integer updateByDistributions(String key, String mail);

    /**
     * listDistribution
     * @return
     */
    List<String> listDistribution();

    /**
     * 更新预约信息
     *
     * @param userBooking
     * @return void
     * @author zhangfeng <feng.zhang@idiaoyan.com>
     * @date 2022/7/11 20:20
     */
    void updateByOrgId(UserBooking userBooking);

    /**
     * 根据更新时间查询
     *
     * @return java.util.List<com.bestcem.xm.om.entity.UserBooking>
     * @author zhangfeng <feng.zhang@idiaoyan.com>
     * @date 2022/8/16 14:17
     */
    List<UserBooking> listByPushStatus();

    /**
     * 通过机构id查询预约信息
     *
     * @param orgIdList
     * @return java.util.List<com.bestcem.xm.om.entity.UserBooking>
     * @author zhangfeng <feng.zhang@idiaoyan.com>
     * @date 2022/8/16 14:24
     */
    List<UserBooking> listByOrgIds(List<String> orgIdList);

    /**
     * 推送状态更新
     *
     * @param bookIds
     * @return void
     * @author zhangfeng <feng.zhang@idiaoyan.com>
     * @date 2022/10/20 17:00
     */
    void updatePushStatusByIds(List<String> bookIds);
}
